package lab01;

public class Test05 {
    public static void main(String[] args) {

   //for循环语句
        int sum1 = 0;
        for (int i = 0; i <= 100; i++) {
            sum1 += i;
        }
        System.out.println("for 语句求100内的和sum1="+sum1);

        //while循环语句
        int sum2 = 0;
        int i = 1;
        while (i <= 100) {
            sum2 += i;
            i = i + 1;
        }
        System.out.println("while 语句求100内的和sum2="+sum2);

     //do while循环语句
        int sum3 = 0;
        int n = 0;
        do {
            sum3 += n;
            n = n + 1;
        } while (n <= 100);
        System.out.println("do while 语句求100内的和sum3="+sum3);
    }
}


